﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Web.Mvc;

namespace PessModel
{
    public partial class ExpertJudge
    {
        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email address")]
        public string Email { get; set; }

        //[Required]
        //[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        //[DataType(DataType.Password)]
        //[Display(Name = "Password")]
        //public string Password { get; set; }
    }

    [MetadataType(typeof(ArchiveMetaData))]
    public partial class Archive
    {
        public string CalculatedSerialNumber
        {
            get
            {
                return string.Format("Y{0}A{1}S{2}V{3}",
                    this.Subject.Activity.AdminYear.Value.Year,
                    this.Subject.ActivityID,
                    this.SubjectID,
                    this.ID
                    );
            }
        }
    }
    public class ArchiveMetaData
    {
        //[DataType(DataType.MultilineText)]
        [AllowHtml]
        [UIHint("tinymce_full")]
        public string SchoolComment { get; set; }

        //[DataType(DataType.MultilineText)]
        [AllowHtml]
        [UIHint("tinymce_full")]
        public string CountyEBComment { get; set; }

        [DisplayFormat(DataFormatString = "{0:yyyy年MM月dd日}")]
        public Nullable<System.DateTime> Birthdate { get; set; }

    }

    [MetadataType(typeof(RuleMetaData))]
    public partial class Rule
    {
    }
    public class RuleMetaData
    {
        [Required]
        public string Name { get; set; }
        [Required]
        [Range(0,Int32.MaxValue)]
        public int Value { get; set; }
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }
    }

    [MetadataType(typeof(ActivityMetaData))]
    public partial class Activity
    {
    }
    public class ActivityMetaData
    {
        //[DataType(DataType.MultilineText)]
        [AllowHtml]
        [UIHint("tinymce_full")]
        public string Description { get; set; }

        [DisplayFormat(DataFormatString = "{0:yyyy年MM月dd日}")]
        public Nullable<System.DateTime> StartDate { get; set; }

        [DisplayFormat(DataFormatString = "{0:yyyy年MM月dd日}")]
        public Nullable<System.DateTime> DueDate { get; set; }

        [DisplayFormat(DataFormatString = "{0:yyyy年}", ApplyFormatInEditMode = true)]
        public Nullable<System.DateTime> AdminYear { get; set; }
        
        [DisplayFormat(DataFormatString = "{0:yyyy年MM月dd日}")]
        public Nullable<System.DateTime> ReviewStartDate { get; set; }
        
        [DisplayFormat(DataFormatString = "{0:yyyy年MM月dd日}")]
        public Nullable<System.DateTime> ReviewDueDate { get; set; }
        
        [DisplayFormat(DataFormatString = "{0:yyyy年MM月dd日}")]
        public Nullable<System.DateTime> UploadStartDate { get; set; }
        
        [DisplayFormat(DataFormatString = "{0:yyyy年MM月dd日}")]
        public Nullable<System.DateTime> UploadDueDate { get; set; }
    }

    [MetadataType(typeof(SubjectMetaData))]
    public partial class Subject
    {
    }
    public class SubjectMetaData
    {
        [DataType(DataType.MultilineText)]
        public string ScoringInstruction { get; set; }
    }
}
